package com.mxy.myapplication.asynctask;

import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.os.Message;

import com.mxy.myapplication.util.Util;

/**
 * 将裁剪好的图片转换成圆形图片
 */

public class AsyncTaskForMakeRoundPhoto extends AsyncTask<Integer, Integer, Integer> {

    private Bitmap bitmap;
    private Message m;

    public AsyncTaskForMakeRoundPhoto(Bitmap bitmap, Message m) {
        this.bitmap = bitmap;
        this.m = m;
    }

    @Override
    protected Integer doInBackground(Integer[] params) {

        bitmap = Util.makeRoundBitmap(bitmap);
        m.obj = bitmap;

        return 1;
    }

    @Override
    protected void onPostExecute(Integer o) {
        m.sendToTarget();
    }
}